//
//  PostWorkManTableView.m
//  operativeSide
//
//  Created by 王春程 on 16/6/6.
//  Copyright © 2016年 com.caocaod.www. All rights reserved.
//

#import "PostWorkManTableView.h"
#import "PostWorkManButtonCell.h"
#import "PostWorkManCell.h"


@interface PostWorkManTableView()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation PostWorkManTableView
static NSString *identifier = @"PostWorkManCell";
static NSString *buttonIdentifier = @"PostWorkManButtonCell";

- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
    if(self = [super initWithFrame:frame style:style]) {
        [self registerClass:[PostWorkManCell class] forCellReuseIdentifier:identifier];
        [self registerClass:[PostWorkManButtonCell class] forCellReuseIdentifier:buttonIdentifier];
        self.dataSource = self;
        self.delegate = self;
        self.separatorStyle = UITableViewCellSeparatorStyleNone;
        self.backgroundColor = RGB(232, 232, 232);
        [self addMJRefreshHeader:@selector(loadNewData)];
        [self addMJRefreshFooter:@selector(loadMoreData)];
        
    }
    return self;
}

- (void)loadNewData {

}

- (void)loadMoreData {


}

#pragma mark - UITableViewD
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//    return self.dataArr.count + 1;
    return 16;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
//    if(nil != self.dataArr || 0 != self.dataArr.count) {
//        if(0 == indexPath.row) {
//            return 65;
//        } else {
//            postWorkManJPieces *pieces = self.dataArr[indexPath.row - 1];
//            NSString *phoneString = pieces.phoneRecipient;
//            if(phoneString.length == 0 || phoneString == nil) {
//                return 89;
//            } else {
//                return 155;
//            }
//        }
//    } else {
//        return 65;
//    }
    
    if(indexPath.row == 0) {
        return 58;

    } else {
        
        return 123;
    }
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//    if(nil != self.dataArr || 0 != self.dataArr.count) {
        if(0 == indexPath.row) {
            PostWorkManButtonCell *buttonCell = [tableView dequeueReusableCellWithIdentifier:buttonIdentifier forIndexPath:indexPath];
            return buttonCell;
        } else {
            PostWorkManCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
//                postWorkManJPieces *piece = self.dataArr[indexPath.row - 1];
//                cell.pieces = piece;
                return cell;
        }
//    } else {
//        PostWorkManButtonCell *buttonCell = [tableView dequeueReusableCellWithIdentifier:buttonIdentifier forIndexPath:indexPath];
//        return buttonCell;
//    }
}



#pragma mark -_- connectNet
- (void)loadDataWithLastId:(NSString *)lastIdString {


}

- (void)loadSearchDataWithSearchString:(NSString *)searchString {

}
@end
